ssize_t rio_readlineb(rio_t *rp, void *usrbuf, size_t maxlen) 
{
    int n, rc;
    char c, *bufp = usrbuf;

    for (n = 1; n < maxlen; n++) { //最多是maxlen-1个
    if ((rc = rio_read(rp, &c, 1)) == 1) {
        *bufp++ = c;
        if (c == '\n')//找到换行符，就退出
        break;
    } else if (rc == 0) {
        if (n == 1)
        return 0; /* EOF,并且没有读到数据 */
        else
        break;    /* EOF,有数据，出现不足值 */
    } else
        return -1;    /* 错误，返回-1 */
    }
    *bufp = 0;
    return n;//返回成功传送的字节数
}
